home *** CD-ROM | disk | FTP | other *** search
-
-
-
- CREAT(3) MINTLIB LIBRARY FUNCTIONS CREAT(3)
-
-
- N✓NA✓AM✓ME✓E
- creat - create a new file
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- int creat(const char *path, unsigned int mode);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- This interface is made obsolete by open, since,
-
- creat(path, mode);
-
- is equivalent to
-
- open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
-
- which actually is the way creat is implemented.
-
- creat creates a new ordinary file or prepares to rewrite
- an existing file named by the pathname pointed to by path.
- If the file did not exist, it is given the mode 'mode', as
- modified by the process's mode mask (see umask). See stat
- for the construction of mode.
-
- If the file exists, its mode and owner remain unchanged,
- but it is truncated to 0 length. Otherwise, the file's
- owner ID is set to the effective user ID of the process,
- and upon successful completion, creat marks for update the
- st_atime, st_ctime, and st_mtime fields of the file (see
- stat) and the st_ctime and st_mtime fields of the parent
- directory.
-
- Upon successful completion, the file descriptor is
- returned and the file is open for writing, even if the
- access permis- sions of the file mode do not permit writ-
- ing. The file pointer is set to the beginning of the file.
- The file descriptor is set to remain open across execve
- system calls. See fcntl.
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- creat returns a non-negative descriptor that only permits
- writing on success. On failure, it returns -1 and sets
- errno to indicate the error.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- c✓cl✓lo✓os✓se✓e(✓(3✓3)✓),✓, c✓ch✓hm✓mo✓od✓d(✓(3✓3)✓),✓, e✓ex✓xe✓ec✓cv✓ve✓e(✓(3✓3)✓),✓, f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓, f✓fl✓lo✓oc✓ck✓k(✓(3✓3)✓),✓,
- o✓op✓pe✓en✓n(✓(3✓3)✓),✓, w✓wr✓ri✓it✓te✓e(✓(3✓3)✓),✓, u✓um✓ma✓as✓sk✓k(✓(3✓3)✓)
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-